import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'stockFilter'
})
export class StockFilterPipe implements PipeTransform {

  transform(lists: any[],flied:string,keyword:string): any {
      if(!flied || !keyword){
        return lists;
      }
      return lists.filter(item =>{
        let listsItem = item[flied];
        return listsItem.indexOf(keyword)>=0;
      })
  }

}
